package com.zqc.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zqc.service.*;
import com.zqc.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;

import javax.servlet.http.HttpServletRequest;


/**
 * 所有Controller的公共部分
 */
public class BaseController {
    @Autowired
    public HttpServletRequest req;

    @Autowired
    public RedisUtil redisUtil;

    @Autowired
    public SysUserService sysUserService;

    @Autowired
    public SysRoleService sysRoleService;

    @Autowired
    public SysMenuService sysMenuService;

    @Autowired
    public SysRoleMenuService roleMenuService;

    @Autowired
    public SysUserRoleService userRoleService;

    public Page getPage() {
        int current = ServletRequestUtils.getIntParameter(req,"current",1);
        int size = ServletRequestUtils.getIntParameter(req,"size",10);
        return new Page(current,size);
    }
}
